import { IQuery } from './../models/common/common';
import { HttpServerFactory, httpServicesEnum } from "src/common/factories/http";
import { IExample, IPagationItems } from "src/models/examples/example";

interface IExampleQuery{
  x?:number
}

export default class ExampleService{
  private mockTestHttpServer = HttpServerFactory.current.getHttpServer(httpServicesEnum.mockHttpServer)
  
  public getResourcesById (id:number) {
    return this.mockTestHttpServer.get<IExample>(`/resources/${id}`)
  }

  public queryResources (query:IQuery<IExampleQuery>) {
    return this.mockTestHttpServer.getResources<IPagationItems<IExample>>('resources', query)
  }
}
